import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: () => { return import('@/views/login') }
  },
  {
    path: '/',
    component: () => { return import('@/views/layout') },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => { return import('@/views/home') }
      },
      {
        path: '/qa',
        component: () => { return import('@/views/qa') }
      },
      {
        path: '/my',
        component: () => { return import('@/views/my') }
      }
    ]
  },
  {
    path: '/article/:id',
    name: 'article',
    component: () => import('@/views/article'),
    props: true
  }
]

const router = new VueRouter({
  routes
})

export default router
